(function() {
    __manager = null;
    
    function Manager()
    {
        
    }

    Manager.prototype.onFarmAction = function(evt)
    {
        log.info("onFarmAction", evt);
        if (evt.actionCode == FARM_ACTION_BUY)
        {
            if (evt.actionValue)
            {
                var msg = new UI.SimpleDialogBox("You have buy " + evt.actionValue.num + " " + evt.actionValue.name);
                msg.doModal();
            }
            else
            {
                var msg = new UI.SimpleDialogBox("buy failed.");
                msg.doModal();
            }
        }
        else if (evt.actionCode == FARM_ACTION_SELL)
        {
            if (evt.actionValue)
            {
                var msg = new UI.SimpleDialogBox("You have sell " + evt.actionValue.num + " " + evt.actionValue.name);
                msg.doModal();
            }
            else
            {
                var msg = new UI.SimpleDialogBox("sell failed.");
                msg.doModal();
            }
        }
    }
    
    ActionManager = new Object();
    ActionManager.createManager = function() {
        __manager = new Manager();
        ActionManager.getManager = function() {return __manager;}
        ActionManager.createManager = null;
    }
    
})();